package com.castle.fortress.admin.cms.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.castle.fortress.admin.cms.dto.CmsChannelDto;
import com.castle.fortress.admin.cms.entity.CmsChannelEntity;
import com.castle.fortress.common.entity.RespBody;
import org.springframework.scheduling.annotation.Async;

import java.util.List;
import java.util.Map;

/**
 * cms栏目/导航菜单配置表 服务类
 *
 * @author castle
 * @since 2022-03-09
 */
public interface CmsChannelService extends IService<CmsChannelEntity> {

    /**
     * 分页展示cms栏目/导航菜单配置表列表
     * @param page
     * @param cmsChannelDto
     * @return
     */
    IPage<CmsChannelDto> pageCmsChannel(Page<CmsChannelDto> page, CmsChannelDto cmsChannelDto);


    /**
     * 展示cms栏目/导航菜单配置表列表
     * @param cmsChannelDto
     * @return
     */
    List<CmsChannelDto> listCmsChannel(CmsChannelDto cmsChannelDto);

    /**
     * 检查字段是否重复
     * @param dto
     * @return
     */
    RespBody checkColumnRepeat(CmsChannelDto dto);

    /**
     * 用于cms标签
     * @param map
     * @return
     */
    List<CmsChannelDto> cmsTagListCmsChannel(Map<String, Object> map);

    /**
     * 获取当前栏目的面包屑 用于cms页面
     * @param dto
     * @return
     */
    List<CmsChannelDto> cmsTagPositionByDto(CmsChannelDto dto);

    /**
     * 异步更新栏目及子栏目的审核人员信息
     * @param cmsChannelDto,oldEntity
     * }
     */
    @Async
    void auditChild(CmsChannelDto cmsChannelDto,CmsChannelEntity oldEntity);

    /**
     * 指定角色拥有操作权限的栏目列表
     * @param roldIds
     * @return
     */
    List<CmsChannelDto> authListCmsChannel(List<Long> roldIds);

    /**
     * 指定用户拥有操作权限的栏目树形展示
     * @param roldIds
     * @return
     */
    List<CmsChannelDto> authTreeCmsChannel(List<Long> roldIds);
}
